<?php /*a:1:{s:53:"D:\sll\WWW\ls_shop\app\admin\view\shop\shop_edit.html";i:1636094974;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>编辑店主</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/frame.css">

    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
</head>
<body>           
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>编辑门店信息</legend>
</fieldset>

<form class="layui-form layui-form-pane" action="" lay-filter="example" style="padding: 20px">
    <input type="hidden" name="id" value="<?php echo htmlentities($info['id']); ?>" lay-verify="id">

    <div class="layui-form-item">
        <label class="layui-form-label">门店分类</label>
        <div class="layui-input-inline" style="width: 40%">
            <?php foreach($cate_list as $k => $v): if((in_array($v['id'], $cate_arr) != false)): ?>
                <input type="checkbox" name="rule" value="<?php echo htmlentities($v['id']); ?>" title="<?php echo htmlentities($v['name']); ?>" checked>
            <?php else: ?>
                <input type="checkbox" name="rule" value="<?php echo htmlentities($v['id']); ?>" title="<?php echo htmlentities($v['name']); ?>">
            <?php endif; ?>
            <?php endforeach; ?>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">门店名称</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="text" name="name" value="<?php echo htmlentities($info['name']); ?>" lay-verify="name" autocomplete="off" placeholder="请输入门店名称" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">营业时间</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="text" name="business_time" value="<?php echo htmlentities($info['business_time']); ?>" lay-verify="business_time" autocomplete="off" placeholder="请输入营业时间" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">门店简介</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="text" name="brief" value="<?php echo htmlentities($info['brief']); ?>" lay-verify="brief" autocomplete="off" placeholder="请输入门店简介" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">申请简介</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="text" name="brief_apply" value="<?php echo htmlentities($info['brief_apply']); ?>" lay-verify="brief_apply" autocomplete="off" placeholder="请输入申请简介" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">最小保证金</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="number" name="bond_min" value="<?php echo htmlentities($info['bond_min']); ?>" lay-verify="bond_min" autocomplete="off" placeholder="请输入最小保证金" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">最大保证金</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="number" name="bond_max" value="<?php echo htmlentities($info['bond_max']); ?>" lay-verify="bond_max" autocomplete="off" placeholder="请输入最大保证金" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">股份限额</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="number" name="shareholder_money" value="<?php echo htmlentities($info['shareholder_money']); ?>" lay-verify="shareholder_money" autocomplete="off" placeholder="请输入股份份额" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">股东限量</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="number" name="shareholder_num" value="<?php echo htmlentities($info['shareholder_num']); ?>" lay-verify="shareholder_num" autocomplete="off" placeholder="请输入股东人数" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item" id="x-city">
        <label class="layui-form-label">地区</label>
        <div class="layui-input-inline">
            <select name="province" lay-filter="province">
                <option value="">请选择省</option>
            </select>
        </div>
        <div class="layui-input-inline">
            <select name="city" lay-filter="city">
                <option value="">请选择市</option>
            </select>
        </div>
        <div class="layui-input-inline">
            <select name="area" lay-filter="area">
                <option value="">请选择县/区</option>
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">详细地址</label>
        <div class="layui-input-inline" style="width: 40%">
            <input type="text" name="street" value="<?php echo htmlentities($info['street']); ?>" lay-verify="street" autocomplete="off" placeholder="请输入详细地址" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">营业执照</label>
        <div class="layui-input-inline" style="width: 40%">
            <img src="<?php echo htmlentities($info['license']); ?>" alt="">
        </div>

        
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="submit">立即提交</button>
            <a href="javascript:history.back(-1)" class="layui-btn layui-btn-primary">返回</a>
        </div>
    </div>
</form>
          
<script src="/static/layui/layui.js" charset="utf-8"></script>
<script src="/static/js/xcity.js" type="text/javascript"></script>

<script>
    layui.use(['form'], function(){
        form = layui.form
        layer = layui.layer

        $('#x-city').xcity(`<?php echo htmlentities($info['province']); ?>`, `<?php echo htmlentities($info['city']); ?>`, `<?php echo htmlentities($info['area']); ?>`);

        // 监听提交
        form.on('submit(submit)', function(data){
            // 加载中样式... 
            let loading = layer.msg('正在修改，请稍后...', {icon: 16, shade: 0.3, time:0});

            $.post('<?php echo url("Shop/shop_edit_data"); ?>', data.field, function(res){
                layer.close(loading);
                if(res.code == 0){
                    layer.msg(res.msg, {icon: 1,time: 1500}, function(){
                        history.back(-1);
                    });
                }else{
                    layer.msg(res.msg, {icon: 2});
                }
            })

            return false;
        });
    });
</script>
</body>
</html>